package cn.ha.toy.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping(value = "books")
public class BookController {

	@RequestMapping(value = "/{id}")
	@ResponseBody
	public String getBook(@PathVariable("id") String id) {
//		Hello helloProxy = new HelloProxy();
//		helloProxy.say("Jack");
		
		return id;
	}
	
	@RequestMapping
	@ResponseBody
	public void getBooks() {
//		Hello hello = new HelloImpl();
//		DynamicProxy proxy = new DynamicProxy(hello);
//		Hello helloProxy = (Hello) Proxy.newProxyInstance(
//				hello.getClass().getClassLoader(), 
//				hello.getClass().getInterfaces(),
//				proxy);
//		helloProxy.say("Tom");
		
	}
}
